<?php


namespace app\api\validate;


use think\Validate;

class WalletValidate extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'mold' => ['require', 'in:all,earning,expend'],
        'start_time' => ['date'],
        'end_time' => ['date'],
        'money' => ['require','gt:0'],
        'platform' => ['require', 'in:pc,mini,app'],
        'pay_type' => ['require', 'in:wxpay,alipay'],
    ];

    /**
     * 提示消息
     */
    protected $message = [];

    /**
     * 验证场景
     */
    protected $scene = [
        'getMoneyLogPageList' => ['mold','start_time','end_time'],
        'rechargeMoney' => ['money','platform','pay_type'],
        'getScoreLogPageList' => ['mold','start_time','end_time'],
        'getBrokerageLogPageList' => ['start_time','end_time'],
    ];

    public function __construct(array $rules = [], $message = [], $field = [])
    {
        $this->field = [
            'mold' => '类型:all=全部,earning=收入,expend=支出',
            'start_time' => '筛选开始时间',
            'end_time' => '筛选结束时间',
            'money' => '金额',
        ];
        parent::__construct($rules, $message, $field);
    }
}